﻿@{
    ViewBag.Title = "Regis";
    Layout = "~/Views/Shared/_UserManage.cshtml";
}
@model BlogUsersSet
<style type="text/css">
    .logo {
        /*background-color: #0094ff;*/
        margin: 50px auto;
        margin-bottom: 10px;
        width: 250px;
        text-align: center;
    }

    .div_body {
        background-color: #faf7f7;
        margin: 0px auto;
        margin-top: 0px;
        width: 250px;
        padding: 30px;
        border-color: #808080;
    }

        .div_body div {
            margin: 5px auto;
            width: 200px;
        }

    .txt_user, .txt_pass, .txt_mail, .txt_Nickname {
        width: 200px;
        height: 20px;
    }

    .button {
        width: 75px;
        height: 25px;
    }

    .div_top .regis {
        color: #8e5555;
        font-weight: 600;
    }
</style>
@{
    ViewBag.Title = "注册";
}

<div class="logo">
    <a href="/">
        <span style="color:#be7a7a;font-size:30px">嗨 博客</span>
        <img src="~/Imgs/bubble_message_hi_64px_1189254_easyicon.net.png" />
    </a>
</div>
<div class="div_body">
    @using (Ajax.BeginForm(new AjaxOptions()
                                            {
                                                OnSuccess = "OnSuccess",
                                                OnFailure = "OnFailure",
                                                Url = Url.RouteUrl("ControllerAction", new { controller = "UserManage", action = "Regis" }),
                                                OnBegin = "OnBegin",
                                                OnComplete = "OnComplete"
                                            }))
    {
        <div>
            用户名：<span class="red">*</span>
            <span class="VeriMess">@Html.ValidationMessageFor(t => t.UserName)</span>
        </div>
        <div>
            @Html.TextBoxFor(t => t.UserName, new { @class = "txt_user" })
        </div>
        <div>昵称：</div>
        <div>
            @Html.TextBoxFor(t => t.UserNickname, new { @class = "txt_Nickname" })
        </div>
        <div>
            密码：<span class="red">*</span>
            <span class="VeriMess">@Html.ValidationMessageFor(t => t.UserPass)</span>
        </div>
        <div>
            @Html.PasswordFor(t => t.UserPass, new { @class = "txt_pass" })
        </div>
        <div>
            邮箱：<span class="red">*</span>
            <span class="VeriMess">@Html.ValidationMessageFor(t => t.UserMail)</span>
        </div>
        <div>
            @Html.TextBoxFor(t => t.UserMail, new { @class = "txt_mail" })
        </div>
        <div style="margin-top:15px">
            <input class="button" type="submit" value="注册" />
            <span class="VeriMess alertMess"></span>
        </div>
    }
</div>

@*<script src="~/Scripts/jquery-1.8.2.js"></script>*@
@*<script src="~/Scripts/blog/jquery.BlogCommon.js"></script>*@
<script type="text/javascript">

    function OnBegin(obj) {
        $(".button").attr("disabled", true);
    }

    function OnComplete() {
        if ($(".alertMess").html()) {
            $(".button").attr("disabled", false);
        }
    }

    function OnSuccess(obj) {
        if (ShowAjaxResult(obj, ".alertMess")) {
            //$.getJSON()
        }
    }

    function OnFailure() {
    }
</script>
